docs(android): Introduce Android ProfilingManager options#18481
docs(android): Introduce Android ProfilingManager options#18481markushi wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
UI Profiling relies on the Android ProfilingManager, which rate limits profiling requests at the framework level on top of the SDK sampling rate. Document this in the Limitations section and add a callout with the shell command to disable the restrictions for local testing. Co-Authored-By: Claude <noreply@anthropic.com>
|
|
||
| <SdkOption name="useProfilingManager" type="bool" defaultValue="false" availableSince="8.45.0"> | ||
|
|
||
| When `true`, UI Profiling uses the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</Link> to capture <Link to="https://perfetto.dev/">Perfetto</Link> traces. This is the recommended backend and requires Android 15 (API level 35) or higher. On older devices, profiling won't run and there is no fallback to the legacy profiler. When `false`, the SDK uses the <PlatformLink to="/profiling/legacy">legacy `tracer` backend</PlatformLink>. |
There was a problem hiding this comment.
| When `true`, UI Profiling uses the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</Link> to capture <Link to="https://perfetto.dev/">Perfetto</Link> traces. This is the recommended backend and requires Android 15 (API level 35) or higher. On older devices, profiling won't run and there is no fallback to the legacy profiler. When `false`, the SDK uses the <PlatformLink to="/profiling/legacy">legacy `tracer` backend</PlatformLink>. | |
| When `true`, UI Profiling uses the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</Link> to capture <Link to="https://perfetto.dev/">Perfetto</Link> traces. This is the preferred profiling implementation and requires Android 15 (API level 35) or higher. On older devices, profiling won't run and there is no fallback to the legacy profiler. When `false`, the SDK uses the <PlatformLink to="/profiling/legacy">legacy `tracer` backend</PlatformLink>. |
| --- | ||
| title: Legacy Profiling | ||
| sidebar_title: Legacy Profiling | ||
| description: "Learn about the legacy profiling implementations and how to use them on devices below Android 15." |
There was a problem hiding this comment.
| description: "Learn about the legacy profiling implementations and how to use them on devices below Android 15." | |
| description: "Learn about the legacy profilers and how to use them on devices running Android versions earlier than Android 15." |
|
|
||
| <Alert level="warning" title="Legacy"> | ||
| This page documents Sentry's legacy Android profilers. The recommended way to | ||
| profile your app is the{" "} |
There was a problem hiding this comment.
| profile your app is the{" "} | |
| profile your app is the is the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>, available since SDK version `8.45.0`. Use the legacy profilers only when you need to support devices running below Android 15 (API level 35), or while migrating from an older setup. |
There was a problem hiding this comment.
Putting this all on one line to fix a formatting issue.
| <Alert level="warning" title="Legacy"> | ||
| This page documents Sentry's legacy Android profilers. The recommended way to | ||
| profile your app is the{" "} | ||
| <PlatformLink to="/profiling/"> |
There was a problem hiding this comment.
| <PlatformLink to="/profiling/"> |
| This page documents Sentry's legacy Android profilers. The recommended way to | ||
| profile your app is the{" "} | ||
| <PlatformLink to="/profiling/"> | ||
| ProfilingManager (Perfetto) based UI Profiling |
There was a problem hiding this comment.
| ProfilingManager (Perfetto) based UI Profiling |
| profile your app is the{" "} | ||
| <PlatformLink to="/profiling/"> | ||
| ProfilingManager (Perfetto) based UI Profiling | ||
| </PlatformLink> |
There was a problem hiding this comment.
| </PlatformLink> |
| </PlatformLink> | ||
| , available since SDK version `8.45.0`. Use the legacy profilers only when you |
There was a problem hiding this comment.
| </PlatformLink> | |
| , available since SDK version `8.45.0`. Use the legacy profilers only when you |
| ProfilingManager (Perfetto) based UI Profiling | ||
| </PlatformLink> | ||
| , available since SDK version `8.45.0`. Use the legacy profilers only when you | ||
| need to support devices running below Android 15 (API level 35), or while |
There was a problem hiding this comment.
| need to support devices running below Android 15 (API level 35), or while |
| </PlatformLink> | ||
| , available since SDK version `8.45.0`. Use the legacy profilers only when you | ||
| need to support devices running below Android 15 (API level 35), or while | ||
| migrating from an older setup. |
There was a problem hiding this comment.
| migrating from an older setup. |
| <Alert level="warning" title="Important"> | ||
| Legacy UI Profiling and transaction-based profiling use the Android runtime's | ||
| `tracer` under the hood to sample threads. There are known issues that this | ||
| `tracer` can cause crashes in certain circumstances. See this{" "} |
There was a problem hiding this comment.
| `tracer` can cause crashes in certain circumstances. See this{" "} | |
| `tracer` can cause crashes in certain circumstances. See this <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> troubleshooting </PlatformLink> entry for more information. The ProfilingManager (Perfetto) based <PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by these issues. |
| Legacy UI Profiling and transaction-based profiling use the Android runtime's | ||
| `tracer` under the hood to sample threads. There are known issues that this | ||
| `tracer` can cause crashes in certain circumstances. See this{" "} | ||
| <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> |
There was a problem hiding this comment.
| <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> |
| `tracer` under the hood to sample threads. There are known issues that this | ||
| `tracer` can cause crashes in certain circumstances. See this{" "} | ||
| <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> | ||
| troubleshooting |
There was a problem hiding this comment.
| troubleshooting |
| `tracer` can cause crashes in certain circumstances. See this{" "} | ||
| <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> | ||
| troubleshooting | ||
| </PlatformLink>{" "} |
There was a problem hiding this comment.
| </PlatformLink>{" "} |
| <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated"> | ||
| troubleshooting | ||
| </PlatformLink>{" "} | ||
| entry for more information. The ProfilingManager (Perfetto) based{" "} |
There was a problem hiding this comment.
| entry for more information. The ProfilingManager (Perfetto) based{" "} |
| troubleshooting | ||
| </PlatformLink>{" "} | ||
| entry for more information. The ProfilingManager (Perfetto) based{" "} | ||
| <PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by |
There was a problem hiding this comment.
| <PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by |
| </PlatformLink>{" "} | ||
| entry for more information. The ProfilingManager (Perfetto) based{" "} | ||
| <PlatformLink to="/profiling/">UI Profiling</PlatformLink> is not affected by | ||
| these issues. |
There was a problem hiding this comment.
| these issues. |
|
|
||
| ## Legacy UI Profiling | ||
|
|
||
| Legacy UI Profiling is available starting in SDK version `8.7.0` and is supported on API level 21 and up. |
There was a problem hiding this comment.
| Legacy UI Profiling is available starting in SDK version `8.7.0` and is supported on API level 21 and up. | |
| Legacy UI Profiling is available starting with SDK version `8.7.0` and is supported on API level 21 and up. |
|
|
||
| <Alert> | ||
|
|
||
| This is the oldest profiling implementation and will eventually be deprecated. We recommend upgrading to the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>. The same behaviour, without the 30 seconds limitation, can be achieved with the trace lifecycle. In order to upgrade, you also need to remove the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling options</PlatformLink> from your configuration. |
There was a problem hiding this comment.
| This is the oldest profiling implementation and will eventually be deprecated. We recommend upgrading to the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>. The same behaviour, without the 30 seconds limitation, can be achieved with the trace lifecycle. In order to upgrade, you also need to remove the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling options</PlatformLink> from your configuration. | |
| This is the oldest profiling implementation and will eventually be deprecated. We recommend upgrading to the <PlatformLink to="/profiling/">ProfilingManager (Perfetto) based UI Profiling</PlatformLink>. The same behavior, without the 30 seconds limitation, can be achieved with the trace lifecycle. In order to upgrade, you also need to remove the <PlatformLink to="/configuration/options/#transaction-based-profiling-options">transaction-based profiling options</PlatformLink> from your configuration. |
| <Alert level="info" title="Improved Profiling Coming Soon"> | ||
| We're working on a more stable profiling solution based on the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager APIs (Perfetto)</Link>. Follow the <Link to="https://github.com/getsentry/sentry-java/discussions/5560">discussion on GitHub</Link> for updates. | ||
| <Alert level="info" title="Using the recommended profiler?"> | ||
| The crash-related issues below only affect{" "} |
There was a problem hiding this comment.
| The crash-related issues below only affect{" "} | |
| The crash-related issues below only affect <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which uses the Android runtime's `tracer`. The recommended <PlatformLink to="/profiling/"> ProfilingManager (Perfetto) based UI Profiling </PlatformLink> is not affected. |
| We're working on a more stable profiling solution based on the Android <Link to="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager APIs (Perfetto)</Link>. Follow the <Link to="https://github.com/getsentry/sentry-java/discussions/5560">discussion on GitHub</Link> for updates. | ||
| <Alert level="info" title="Using the recommended profiler?"> | ||
| The crash-related issues below only affect{" "} | ||
| <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which |
There was a problem hiding this comment.
| <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which |
| <Alert level="info" title="Using the recommended profiler?"> | ||
| The crash-related issues below only affect{" "} | ||
| <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which | ||
| uses the Android runtime's `tracer`. The recommended{" "} |
There was a problem hiding this comment.
| uses the Android runtime's `tracer`. The recommended{" "} |
| The crash-related issues below only affect{" "} | ||
| <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which | ||
| uses the Android runtime's `tracer`. The recommended{" "} | ||
| <PlatformLink to="/profiling/"> |
There was a problem hiding this comment.
| <PlatformLink to="/profiling/"> |
| <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink>, which | ||
| uses the Android runtime's `tracer`. The recommended{" "} | ||
| <PlatformLink to="/profiling/"> | ||
| ProfilingManager (Perfetto) based UI Profiling |
There was a problem hiding this comment.
| ProfilingManager (Perfetto) based UI Profiling |
| uses the Android runtime's `tracer`. The recommended{" "} | ||
| <PlatformLink to="/profiling/"> | ||
| ProfilingManager (Perfetto) based UI Profiling | ||
| </PlatformLink>{" "} |
There was a problem hiding this comment.
| </PlatformLink>{" "} |
| <PlatformLink to="/profiling/"> | ||
| ProfilingManager (Perfetto) based UI Profiling | ||
| </PlatformLink>{" "} | ||
| is not affected. |
There was a problem hiding this comment.
| is not affected. |
| ## I see an elevated number of crashes in the Android Runtime when profiling is activated | ||
|
|
||
| Profiling uses the Android runtime's `tracer` under the hood to sample threads. There are known issues that this `tracer` can cause crashes in certain circumstances. Read on for more information, and subscribe to this <Link to="https://github.com/getsentry/sentry-java/issues/3679">GitHub issue</Link> for updates. | ||
| <PlatformLink to="/profiling/legacy">Legacy Profiling</PlatformLink> uses the |
There was a problem hiding this comment.
Please follow my examples above and put this in-line to fix the extra line breaks that are appearing here.
| <Alert level="warning"> | ||
| Profiling uses the Android runtime's `tracer` under the hood to sample threads. There are known issues that this `tracer` can cause crashes in certain circumstances. See this <PlatformLink to="/profiling/troubleshooting#i-see-an-elevated-number-of-crashes-in-the-android-runtime-when-profiling-is-activated">troubleshooting</PlatformLink> entry for more information. | ||
| <Alert level="info"> | ||
| Profiling uses the Android{" "} |
There was a problem hiding this comment.
Another section that needs to be in-lined.
coolguyzone
left a comment
There was a problem hiding this comment.
Some of the formatting needs adjusting, but once those are done this looks good to go!
DESCRIBE YOUR PR
Introduce new docs for Android
ProfilingManager.Warning
do not merge before getsentry/sentry-java#5251
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
continuous-profiling-perfettofeature flag was rolled out for both relay